package com.jy.controller;


import com.jy.entity.CwParking;
import com.jy.entity.CwProperty;
import com.jy.entity.PageInfo;
import com.jy.entity.R;
import com.jy.service.ICwPropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * illustriousness.`cw_property` 前端控制器
 * </p>
 *
 * @author WeiQuan
 * @since 2022-11-14
 */
@RestController
@RequestMapping("/property")
public class CwPropertyController {

//    @Autowired
    @Resource
    private ICwPropertyService IC;

//    @GetMapping("/yewuf")
//    public List<CwProperty> CwProperty(){
//        List list = iCwPropertyService.allCwProperty();
//        return list;
//    }
//    查询业务费
    @GetMapping("/yewuf")
    public R yewuf(PageInfo pageInfo){
        System.out.println("=========   ==="+pageInfo.toString());
        PageInfo pageInfo1 = IC.allCwProperty(pageInfo);
        return R.result(pageInfo1);
    }

    //    添加业务费
    @PostMapping("/addywf")
    public R addywf(@RequestBody CwProperty cwProperty){
        int cwf = IC.addCwProperty(cwProperty);
        return R.result(cwf);
    }
    //    删除业务费
    @GetMapping("/delywf/{yid}")
    public R delywf(@PathVariable("yid") Integer yid){
        int fid = IC.delCwProperty(yid);
        return R.result(fid);
    }
    //    修改业务费
    @PostMapping("/upywf")
    public R upywf(@RequestBody CwProperty cwProperty){
        int ywf = IC.upCwProperty(cwProperty);
        return R.result(ywf);
    }
}
